# -*- coding:utf-8
"""
作者: Jia
日期: 2022年04月18日
描述: https://leetcode-cn.com/problems/two-sum/
"""
from typing import List


class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        d = dict()
        for i, num in enumerate(nums):
            if (target - num) in d:
                return [d[target - num], i]
            d[num] = i
